<!DOCTYPE html>
<html>
    <head> 
        <title>Dartmouth College</title>
        <script src="../static/jspsych-6.3.1/jspsych.js"></script>
        <script src="../static/jspsych-6.3.1/plugins/jspsych-survey-text.js"></script>
        <script src="../static/jspsych-6.3.1/plugins/jspsych-call-function.js"></script>
        <script src="../static/jspsych-6.3.1/plugins/jspsych-html-keyboard-response.js"></script>
        <script src="../static/jspsych-6.3.1/plugins/jspsych-html-button-response.js"></script>
        <script src="../static/jspsych-6.3.1/plugins/jspsych-survey-multi-choice.js"></script>
        <script src="../static/jspsych-6.3.1/plugins/jspsych-survey-likert.js"></script>
        <script src="../static/jspsych-6.3.1/plugins/jspsych-test.js"></script>
        <link href="../static/jspsych-6.3.1/css/jspsych.css" rel="stylesheet" type="text/css"></link>
        <script.src = 'https://code.jquery.com/jquery-3.4.1.min.js'></script>
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <body>
    </body> 
    <script>
    
    //variables
    var completion_code = '';    
    var cats = ['zoo animals you would take with you on a plane', 'vegetables that you would use to paint your house']
    //proportionate to number of category members for which we need to gather ratings
    var cat_weights = [99, 53];
    var item_lists = {'vegetables that you would wear as jewelry': ['onions', 'garlic', 'peppers', 'cucumbers', 'tomatoes', 'broccoli', 'brussels sprouts', 'carrots', 'asparagus', 'squash', 'cabbage', 'beets', 'potatoes', 'peas', 'zucchini', 'snap peas', 'corn', 'cherry tomatoes', 'green beans', 'chili peppers', 'lettuce', 'celery', 'cauliflower', 'spinach', 'olives', 'radish', 'apples', 'pears', 'okra', 'pineapples', 'grapes', 'avocado', 'mushrooms', 'eggplant', 'watermelon', 'ginger', 'beans', 'artichokes', 'string beans', 'lima beans', 'chilli peppers', 'turnips', 'kale', 'baby carrots', 'sprouts', 'chives', 'sweet potatoes', 'oranges', 'peaches', 'brussells sprouts', 'cilantro', 'pumpkins', 'parsnips', 'kiwi', 'strawberries', 'shallots', 'leeks', 'peanuts', 'raisins', 'bananas', 'bok choy', 'olives'], 'vegetables that you would use to paint your house': ['cucumbers', 'zucchini', 'eggplant', 'cauliflower', 'broccoli', 'carrots', 'celery', 'spinach', 'lettuce', 'kale', 'asparagus', 'squash', 'corn', 'potatoes', 'peas', 'peppers', 'avocado', 'pumpkins', 'beets', 'tomatoes', 'mushrooms', 'chili peppers', 'green beans', 'brussels sprouts', 'onions', 'garlic', 'cabbage', 'beans', 'rhubarb', 'parsley', 'string beans', 'arugula', 'turnips', 'collard greens', 'sweet potatoes', 'leeks', 'radish', 'green onions', 'bananas', 'seaweed', 'blackberries', 'jalapenos', 'cilantro', 'bok choy', 'okra', 'artichokes', 'watermelon', 'oranges', 'strawberries', 'peaches', 'apples', 'grapes', 'pears'],'vegetables that could be used to catch a fish': ['celery', 'corn', 'cucumbers', 'eggplant', 'squash', 'asparagus', 'carrots', 'mushrooms', 'peppers', 'lettuce', 'zucchini', 'snow peas', 'broccoli', 'cauliflower', 'kale', 'onions', 'radish', 'spinach', 'arugula', 'potatoes', 'leeks', 'turnips', 'beets', 'tomatoes', 'cabbage', 'brussels sprouts', 'peas', 'artichokes', 'green beans', 'jalapenos', 'parsnips', 'seaweed', 'bok choy', 'watercress', 'avocado', 'sweet potatoes', 'pickles', 'yams', 'pumpkins', 'okra', 'garlic', 'apples', 'beans', 'green onions', 'swiss chard', 'sprouts', 'parsley', 'lima beans', 'cilantro', 'scallions'],'zoo animals you would use to pop a balloon': ['narwhal', 'elephant', 'tiger', 'cheetah', 'lion', 'jaguar', 'bear', 'koala', 'giraffe', 'hippo', 'porcupine', 'monkey', 'bird', 'gorilla', 'cougar', 'pufferfish', 'toucan', 'beaver', 'otter', 'chimp', 'hedgehog', 'macaw', 'rhino', 'snake', 'hawk', 'ape', 'orangutan', 'parrot', 'panther', 'anteater', 'camel', 'deer', 'panda', 'alligator', 'leopard', 'wolf', 'swordfish', 'stingray', 'kangaroo', 'turtle', 'bison', 'peacock', 'goat', 'horse', 'dog', 'zebra', 'rabbit', 'lizard', 'flamingo', 'rooster', 'ostrich', 'penguin', 'emu', 'crocodile', 'heron', 'eagle', 'armadillo', 'gazelle', 'lemur', 'antelope', 'hyena', 'moose', 'buffalo', 'wolverine', 'seal', 'stork', 'shark', 'sloth', 'scorpion', 'fox', 'polar bear', 'tarantula', 'whale', 'bat', 'puma', 'dolphin', 'pelican', 'llama', 'owl', 'cobra', 'cat', 'cow', 'chicken'],'zoo animals you would take with you on a plane': ['zebra', 'lion', 'tiger', 'monkey', 'snake', 'giraffe', 'alligator', 'elephant', 'polar bear', 'penguin', 'flamingo', 'peacock', 'chimp', 'turtle', 'tortoise', 'koala', 'sloth', 'parrot', 'gorilla', 'orangutan', 'eagle', 'cheetah', 'macaw', 'butterfly', 'anteater', 'otter', 'lemur', 'wolf', 'red panda', 'rabbit', 'owl', 'fish', 'panda', 'beaver', 'fox', 'lion cub', 'tiger cub', 'bear cub', 'meerkat', 'crocodile', 'seal', 'kangaroo', 'donkey', 'goat', 'bear', 'bird', 'llama', 'rhino', 'coyote', 'bobcat', 'deer', 'pig', 'toucan', 'toad', 'hyena', 'iguana', 'lizard', 'antelope', 'porcupine', 'cat', 'chinchilla', 'groundhog', 'rat', 'prairie dog', 'dog', 'duck', 'ferret', 'bat', 'baby tiger', 'baby giraffe', 'baby lion', 'hippo', 'ape', 'ostrich', 'camel', 'sheep', 'badger', 'snow leopard', 'raccoon', 'squirrel', 'frog', 'mouse', 'spider', 'hawk', 'bison', 'horse', 'falcon', 'leopard', 'gopher', 'lynx', 'capybara', 'baby elephant', 'chicken', 'skunk', 'baboon', 'parakeet', 'bald eagle', 'insect', 'gecko'],'zoo animals that could be trained in gymnastics': ['giraffe', 'monkey', 'koala', 'sloth', 'elephant', 'snake', 'lemur', 'kangaroo', 'panda', 'tiger', 'cat', 'gorilla', 'alligator', 'lion', 'hippo', 'dog', 'bear', 'chimp', 'leopard', 'spider monkey', 'squirrel monkey', 'seal', 'dolphin', 'zebra', 'horse', 'macaw', 'ape', 'bonobo', 'lynx', 'orangutan', 'parrot', 'hyena', 'whale', 'bird', 'goat', 'cougar', 'sea lion', 'turtle', 'meerkat', 'pig', 'pony', 'otter', 'bobcat', 'wolf', 'lizard', 'skunk', 'opossum', 'rhino', 'cheetah', 'ostrich', 'mouse', 'rat', 'owl', 'flamingo', 'gazelle', 'ferret', 'marmoset', 'camel', 'emu', 'fish', 'eagle', 'donkey', 'bat', 'red panda', 'polar bear', 'penguin', 'llama', 'panther', 'rabbit', 'fox', 'jaguar', 'hawk', 'octopus', 'squirrel', 'coyote', 'peacock', 'baboon', 'raccoon', 'swan', 'puma', 'shark', 'deer']};
    var statements = {'zoo animals you would take with you on a plane':{'fur':'It is furry', 'large':'It is large', 'land':'It lives on land', 'quiet':'It is quiet', 'cute':'It is cute', 'flies':'It flies', 'mammal':'It is a mammal', 'sharp teeth':'It has sharp teeth', 'dangerous':'It is dangerous', 'fast':'It is fast', 'tail':'It has a long tail', 'intelligent':'It is intelligent', 'carnivore':'It is carnivorous', 'cool':'It is cool', 'striking':'It is striking', 'think':'You think about it often', 'normal':'It is normal', 'lifespan':'It has a long lifespan', 'nocturnal':'It is nocturnal', 'tropics':'It lives in the tropics', 'pet':'It would make a good pet', 'heavy':'It is heavy', 'typical':'It is typical of zoo animals zoo animals you would take with you on a plane.', 'good':'It is a good zoo animal to take on a plane', '4 legs':'It has 4 legs', 'active':'It is active', 'hooves':'It has hooves'},
                    'zoo animals you would use to pop a balloon': {'fur':'It is furry', 'large':'It is large', 'land':'It lives on land', 'quiet':'It is quiet', 'cute':'It is cute', 'flies':'It flies', 'mammal':'It is a mammal', 'sharp teeth':'It has sharp teeth', 'dangerous':'It is dangerous', 'fast':'It is fast', 'tail':'It has a long tail', 'intelligent':'It is intelligent', 'carnivore':'It is carnivorous', 'cool':'It is cool', 'striking':'It is striking', 'think':'You think about it often', 'normal':'It is normal', 'lifespan':'It has a long lifespan', 'nocturnal':'It is nocturnal', 'tropics':'It lives in the tropics', 'pet':'It would make a good pet', 'heavy':'It is heavy', 'typical':'It is typical of zoo animals you would use to pop a balloon.', 'good':'It is a good zoo animal to use to pop a balloon.', '4 legs':'It has 4 legs','hooves':'It has hooves','colorful':'It is colorful','beak':'It has a beak','pointy':'It is pointy', 'strong':'It is strong'},
                    'zoo animals that could be trained in gymnastics': {'fur':'It is furry', 'large':'It is large', 'land':'It lives on land', 'quiet':'It is quiet', 'cute':'It is cute', 'flies':'It flies', 'mammal':'It is a mammal', 'sharp teeth':'It has sharp teeth', 'dangerous':'It is dangerous', 'fast':'It is fast', 'tail':'It has a long tail', 'intelligent':'It is intelligent', 'carnivore':'It is carnivorous', 'cool':'It is cool', 'striking':'It is striking', 'think':'You think about it often', 'normal':'It is normal', 'lifespan':'It has a long lifespan', 'nocturnal':'It is nocturnal', 'tropics':'It lives in the tropics', 'pet':'It would make a good pet', 'heavy':'It is heavy', 'typical':'It is typical of zoo animals that could be trained in gymnastics.', 'good':'It is a good zoo animal to train in gymnastics', '4 legs':'It has 4 legs', 'climbs':'It climbs well', 'hands':'It has hands', 'graceful':'It is graceful', 'colorful':'It is colorful', 'social':'It is social', 'strong':'It is strong', 'flexible':'It is flexible', 'agile':'It is agile', 'jumps': 'It jumps', 'trees':'It spends time in trees'},
                    'vegetables that you would use to paint your house': {'green':'It is green', 'peel':'It has a peel', 'cooked':'It is cooked before being eaten', 'long':'It is long', 'vegetable':'It is a vegetable', 'large': 'It is large', 'healthy':'It is healthy', 'dishes':'It is used in a large variety of dishes', 'above ground':'It grows above ground', 'seeds':'It has seeds', 'leafy':'It is leafy', 'round':'It is round', 'available': 'It is widely available', 'crunchy':'It is crunchy', 'colorful':'It is colorful', 'heavy':'It is heavy', 'fragrant':'It is fragrant', 'strong flavor':'It has a strong flavor', 'spicy':'It is spicy', 'sweet':'It is sweet', 'good':'It is a good vegetable to use for painting your house', 'likes':'You like it', 'popular':'It is popular', 'think':'You think about it often', 'expensive':'It is expensive', 'warm':'It grows in warm climates', 'typical':'It is typical of vegetables you would use to paint your house.'},
                    'vegetables that you would wear as jewelry': {'green':'It is green', 'peel':'It has a peel', 'cooked':'It is cooked before being eaten', 'long':'It is long', 'vegetable':'It is a vegetable', 'large': 'It is large', 'healthy':'It is healthy', 'dishes':'It is used in a large variety of dishes', 'above ground':'It grows above ground', 'seeds':'It has seeds', 'leafy':'It is leafy', 'round':'It is round', 'available': 'It is widely available', 'crunchy':'It is crunchy', 'colorful':'It is colorful', 'heavy':'It is heavy', 'fragrant':'It is fragrant', 'strong flavor':'It has a strong flavor', 'sweet':'It is sweet', 'good':'It is a good vegetable to wear as jewelry.', 'likes':'You like it', 'popular':'It is popular', 'think':'You think about it often', 'expensive':'It is expensive', 'warm':'It grows in warm climates', 'typical':'It is typical of vegetables that you would wear as jewelry'},
                    'vegetables that could be used to catch a fish': {'green':'It is green', 'stem':'It has a stem', 'long':'It is long', 'vegetable':'It is a vegetable', 'large': 'It is large', 'healthy':'It is healthy', 'dishes':'It is used in a large variety of dishes', 'above ground':'It grows above ground', 'seeds':'It has seeds', 'leafy':'It is leafy', 'round':'It is round', 'available': 'It is widely available', 'crunchy':'It is crunchy', 'colorful':'It is colorful', 'fragrant':'It is fragrant', 'strong flavor':'It has a strong flavor', 'sweet':'It is sweet', 'good':'It is a good vegetable to use to catch a fish', 'likes':'You like it', 'popular':'It is popular', 'think':'You think about it often', 'warm':'It grows in warm climates', 'typical':'It is typical of vegetables that could be used to catch a fish'}}
    var num_descriptors = 16;
    var num_items = 8;
    var cat = jsPsych.randomization.sampleWithoutReplacement(cats, 1, cat_weights)[0];
    var items = jsPsych.randomization.sampleWithoutReplacement(item_lists[cat], num_items);
    var descriptors = jsPsych.randomization.sampleWithoutReplacement(Object.keys(statements[cat]), num_descriptors);
    var item_idx = 0;
    var opts = ['1','2','3','4','5']

    var timeline = [];

    // consent
    var consent = {
        type: "html-button-response",
        stimulus: "<DIV align='left'><div>&nbsp;</div><div>Please consider this information carefully before deciding whether to participate in this research.</div><div>&nbsp;</div><div>The purpose of this research is to examine which factors influence social judgment and decision-</div><div>making. You will be asked to make judgements about individuals and actions in social scenarios.</div><div>We are simply interested in your judgement. The study will take less than 1 hour to complete,</div><div>and you will receive less than $20 on Amazon Mechanical Turk. Your compensation and time</div><div>commitment are specified in the study description. There are no anticipated risks associated with</div><div>participating in this study. The effects of participating should be comparable to those you would</div><div>ordinarily experience from viewing a computer monitor and using a mouse or keyboard for a</div><div>similar amount of time. At the end of the study, we will provide an explanation of the questions</div><div>that motivate this line of research and will describe the potential implications.</div><div>&nbsp;</div><div>Your participation in this study is completely voluntary and you may refuse to participate or you</div><div>may choose to withdraw at any time without penalty or loss of benefits to you which are</div><div>otherwise entitled. Your participation in this study will remain confidential. No personally</div><div>identifiable information will be associated with your data. Also, all analyses of the data will be</div><div>averaged across all the participants, so your individual responses will never be specifically</div><div>analyzed.</div><div>&nbsp;</div><div>If you have questions or concerns about your participation or payment, or want to request a</div><div>summary of research findings, please contact Dr. Jonathan Phillips at</div><div><a href=mailto:Jonathan.S.Phillips@dartmouth.edu>Jonathan.S.Phillips@dartmouth.edu</a>.</div><div>&nbsp;</div><div>Please save a copy of this form for your records.</div><div>&nbsp;</div></DIV><div>Agreement:</div><DIV align='left'><div>The nature and purpose of this research have been sufficiently explained and I agree to</div><div>participate in this study. I understand that I am free to withdraw at any time without incurring</div><div>any penalty. Please consent by clicking the button below to continue. Otherwise, please exit the</div><div>study at any time.</div><div>&nbsp;</div></DIV>",
        choices: ['Submit']
    };

    //welcome
    var welcome = {
	    type: "html-keyboard-response",
	    stimulus: "<div class='center-content'><br><br><br><br>Welcome to the HIT. Press any key to begin.",
    };

    //get subject ID
    var get_id = {
	    type: 'survey-text',
        preamble: ["Please enter your Prolific Worker ID below.<br><br>If you do not enter your ID accurately, we will not be able to pay you."],
        questions: [{prompt: "Worker ID:", name: "subject_id", required: true}],
        on_finish: function(data){
            jsPsych.data.addProperties({
                subject_id: data['response']['subject_id'],
            });
        }
    }

    //instructions
    var instructions1 = {
        type: "html-keyboard-response",
        stimulus: "In this experiment, you will be asked to rate how well different descriptions fit things in a certain category.<br>Press any key to begin!<br>"
    };

    //category specific instructions
    var instructions2 = {
        type: "html-button-response",
        stimulus: "We asked people to name <b>" + cat + "</b>.<br>You will see some of these responses, and be asked to rate how well different descriptions fit these responses.<br>You will see a total of " + num_items + " responses.<br><br>",
        choices: ['Begin']
    };

    //rating trial for one category member
    trial = {
        type: 'survey-likert',
        preamble: function() {
            var item = items[item_idx];
            var art = "a "
            if(['vegetables that you would use to paint your house', 'vegetables that you would wear as jewelry', 'vegetables that could be used to catch a fish'].includes(cat)){
                art="";
            }
            return '<br>In the category of ' + cat + ', consider ' + art + '<b>'+ item + '</b>.<br>Please rate how well described it is by each of the following statements, on a scale from 1 (not well) to 5 (very well).<br>';
        },
        questions: [
            { prompt: statements[cat][descriptors[0]], name: descriptors[0], labels: opts, required: true},
            { prompt: statements[cat][descriptors[1]], name: descriptors[1], labels: opts,  required: true},
            { prompt: statements[cat][descriptors[2]], name: descriptors[2], labels: opts, required: true},
            { prompt: statements[cat][descriptors[3]], name: descriptors[3], labels: opts, required: true},
            { prompt: statements[cat][descriptors[4]], name: descriptors[4], labels: opts, required: true},
            { prompt: statements[cat][descriptors[5]], name: descriptors[5], labels: opts, required: true},
            { prompt: statements[cat][descriptors[6]], name: descriptors[6], labels: opts,  required: true},
            { prompt: statements[cat][descriptors[7]], name: descriptors[7], labels: opts, required: true},
            { prompt: statements[cat][descriptors[8]], name: descriptors[8], labels: opts, required: true},
            { prompt: statements[cat][descriptors[9]], name: descriptors[9], labels: opts, required: true},
            { prompt: statements[cat][descriptors[10]], name: descriptors[10], labels: opts, required: true},
            { prompt: statements[cat][descriptors[11]], name: descriptors[11], labels: opts,  required: true},
            { prompt: statements[cat][descriptors[12]], name: descriptors[12], labels: opts, required: true},
            { prompt: statements[cat][descriptors[13]], name: descriptors[13], labels: opts, required: true},
            { prompt: statements[cat][descriptors[14]], name: descriptors[14], labels: opts, required: true},
            { prompt: statements[cat][descriptors[15]], name: descriptors[15], labels: opts, required: true}
        ],
        on_finish: function(data) {
            t_data = {};
            t_data.exp_phase = "trial";
            t_data.rt = data.rt;
            t_data.responses = data.response;
            t_data.trial_order = item_idx;
            t_data.cat = cat;
            t_data.subject_id = data.subject_id;
            t_data.item = items[item_idx];
            save_data(t_data);
            item_idx = item_idx + 1;
        }
    }

    //demographic information
    var demo_instructions = {
        type: "html-keyboard-response",
        stimulus: "<div>Next, please provide us with some demographic information.</div><div>Press any key to begin.</div>",
    };
    var demo1 = {
        type: 'survey-text',
        preamble: '',
        questions: [{prompt: "How old are you?", required: true}, {prompt: "What is your native language?", required: true}, {prompt: "What is your nationality?", required: true}, {prompt: "In which country do you live?", required: true}],
    };
    //saves data on completion of this trial
    var demo2 = {
        type: 'survey-multi-choice',
        preamble: "Please provide us with some demographic information.",
        questions: [
            {prompt: "What is your gender?", options: ["Male","Female","Other"], required:true}, 
            {prompt: "Are you a student?", options: ["Yes","No"], required: true},
            {prompt: "What is your education level?", options: ["Grade/elementary school","High school","Some college or university","College or university degree","Graduate degree, Masters","PhD"], required: true}
        ],
        on_finish: function(data) {
            data.exp_phase = 'subject_info';
            var lastData = jsPsych.data.get().last(2).values();
            var demo1 = lastData[0]['response'];
            var demo2 = lastData[1]['response'];
            data.age = demo1['Q0'];
            data.language = demo1['Q1'];
            data.nationality = demo1['Q2'];
            data.country = demo1['Q3'];
            data.gender = demo2['Q0'];
            data.student = demo2['Q1'];
            data.education = demo2['Q2'];
            data.completion_code = completion_code;
            save_data(data);
        },
	};

    //provide completion code
    var end = {
        type: "html-button-response",
        stimulus: "<h4>Thank you for your participation!</h4><h4>In order to complete this HIT, you must enter the code below into Prolific.</h4><h4>Your secret completion code is:<br><br>" + completion_code + "<br><br>Copy this code now.</h4><h4>Once you've copied it, click the button below to leave this window.</h4>",
        choices: ['Finish'],
    };

    //debrief
    var end_debrief = {
	    type: "html-keyboard-response",
	    stimulus: "<DIV align='left'><div>&nbsp;</div><div><strong>Study Debriefing</strong></div><div>Judgement and decision making are important aspects of public and private life. Using surveys</div><div>like the one you just completed, we are examining the factors that go into making social</div><div>decisions.</div><div>&nbsp;</div><div><strong>How is this being tested?</strong></div><div>We have asked you to respond to stories or videos that differ on several important factors. By</div><div>isolating different variables that are involved in social thought, we can better understand how we</div><div>arrive at complex decision-making. For example, some actions are seen as more worthy of blame</div><div>if they are performed intentionally. Harming someone on purpose is generally worse than</div><div>harming someone by accident, or even harming someone in a way that is foreseen but not</div><div>intended.</div><div>&nbsp;</div><div><strong>Main questions and hypotheses:</strong></div><div>A fundamental goal of our research is to understand the cognitive and emotional factors that</div><div>influence social judgment and decision-making. We are studying these factors by presenting</div><div>people with hypothetical questions that vary in specific ways and seeing which factors make a</div><div>difference. Some people filled out the same survey that you just filled out. Others got slightly</div><div>different surveys.</div><div>&nbsp;</div><div><strong>Why is this important to study?</strong></div><div>By comparing answers on these important factors, we learn about what factors affect social</div><div>judgment. This has crucial implications for many public domains, including the legal system.</div><div>&nbsp;</div><div><strong>How to learn more:</strong></div><div>If you are interested in learning more, you may want to consult the following articles:</div><div>Phillips, J., &amp; Cushman, F. (2017). Morality constrains the default representation of what is</div><div style='padding-left: 30px;'>possible. Proceedings of the National Academy of Sciences of the United States of</div><div style='padding-left: 30px;'>America, 114(18), 4649&ndash;4654. https://doi.org/10.1073/pnas.1619717114</div><div>Phillips, J., Morris, A., &amp; Cushman, F. (2019). How we know what not to think.</div><div style='padding-left: 30px;'>Trends in Cognitive Sciences, 23(12), 1026&ndash;1040. https://doi.org/10.1016/j.tics.2019.09.007</div><div>Phillips, J., Buckwalter, W., Cushman, F., Friedman, O., Martin, A., Turri, J., Santos, L., &amp;</div><div style='padding-left: 30px;'>Knobe, J. (2020). Knowledge before Belief. Behavioral and Brain Sciences, 1-37.</div><div style='padding-left: 30px;'>doi:10.1017/S0140525X20000618</div><div>&nbsp;</div><div><strong>How to contact the researcher:</strong></div><div>If you have questions or concerns about your participation or</div><div>payment, or want to request a summary of research findings, please contact the Primary</div><div>Investigator: Dr. Jonathan Phillips, at Jonathan.S.Phillips@dartmouth.edu.</div><div>Whom to contact about your rights in this research:</div><div>If you have questions, concerns,</div><div>complaints, or suggestions about the present research, you may call the Office of the Committee</div><div>for the Protection of Human Subjects at Dartmouth College (603) 646-6482 during normal</div><div>business hours.</div><div>&nbsp;</div><div><strong>Thank you for your participation!</strong></div><div>&nbsp;</div></DIV>",
    };

    //save data to database
    function save_data(data) {
        var url = "study"; //use this when running on server
        //var url = "/"; //use this when running locally
        var xhr = new XMLHttpRequest();
        xhr.open("POST", url, true);
        xhr.setRequestHeader('Content-Type', 'application/json');
        xhr.send(JSON.stringify({
            data
        }));
    }

    timeline.push(consent);
    timeline.push(welcome);
    timeline.push(get_id);
    timeline.push(instructions1);
    timeline.push(instructions2);
    for (var i = 0; i < num_items; i++) {
        timeline.push(trial);
    };
    timeline.push(demo_instructions)
    timeline.push(demo1);
    timeline.push(demo2);
    timeline.push(end);
    timeline.push(end_debrief);

    jsPsych.init({
        timeline:timeline,
    });

    </script>
</html>